<template>
  <div class="navbar">
    <div class="right-menu">
      <span class="iconfont righticon">&#xe60a;</span>
      <div class="ss">
        <span class="iconfont lefticon">&#xe8cb;</span>
        <span class="iconfont lefticon">&#xeafe;</span>
        <span class="iconfont lefticon">&#xe622;</span>
        <span class="iconfont lefticon">&#xe666;</span>
        <span class="iconfont lefticon">&#xe605;</span>
      </div>
      <span
        class="el-avatar el-avatar--square"
        data-v-afbec1f4
        style="height: 44px; width: 44px; line-height: 44px"
      >
        <img
          src="https://m.imooc.com/static/wap/static/common/img/logo-small@2x.png"
          alt=""
        />
      </span>
      <el-dropdown class="avatar-container" trigger="click">
        <div class="avatar-wrapper">
          <i class="el-icon-s-tools"></i>
        </div>
        <template #dropdown>
          <el-dropdown-menu class="user-dropdown">
            <router-link to="/home">
              <el-dropdown-item> 首页 </el-dropdown-item>
            </router-link>
            <a target="_blank" href="">
              <el-dropdown-item>课程主页</el-dropdown-item>
            </a>
            <el-dropdown-item divided>
              <span style="width: 100%" @click="outlogin">退出登录</span>
            </el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
import { getUserInfo } from "../util/request";
export default {
  name: "Queyu1Navbar",
  data() {
    return {};
  },

  mounted() {
    // this.getUser()
  },

  methods: {
    getUser() {
      getUserInfo().then((res) => {
        console.log(res);
      });
    },
    outlogin() {
      console.log(23);
      this.$router.push("/");
      this.$message("退出成功");
    },
  },
};
</script>

<style lang="scss" scoped>
.navbar {
  height: 50px;

  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);

  .right-menu {
    display: flex;
    align-items: center;
    // padding-right: 16px;
    width: 100%;

    ::v-deep .avatar-container {
      cursor: pointer;
      .avatar-wrapper {
        margin-top: 5px;
        position: relative;
        .el-avatar {
          --el-avatar-background-color: none;
          margin-right: 12px;
        }
      }
    }
  }
}
:after,
:before {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}
.a {
  font-size: 10px;
}

.righticon {
  float: right;
}
.iconfont {
  font-size: 30px;
  margin-left: 20px;
}
.ss {
  margin-left: 1350px;
}
.tags-view-item {
  ::deep {
    position: absolute;
  }
  background-color: gainsboro;
}
</style>